<template>
  <div class="container clearfix">
    <scroll-view scroll-y
                 style="height:100%"
                 scroll-with-animation>
      <div class="content clearfix">
        <div class="top clearfix">
          <img :src="base_url+'/mp_3.2.2/%E7%BC%96%E7%BB%84%204%402x.png'"
               v-if="base_url"
               mode="widthFix"
               alt=""
               class="img">
        </div>
        <!-- 模态框 -->
        <div class="model login"
             v-if="!bind_tel">
          <button class="login-btn"
                  @tap="to_main()">
            我要分享
          </button>
          <div class="back-btn"
               @tap.stop="back()">
            看看其他优惠活动
          </div>
        </div>
      </div>
    </scroll-view>

  </div>

</template>


<script>
import common from '@/assets/js/mmk_common.js'
export default {
  data () {
    return {
      base_url: common.image_resource,
    };
  },
  methods: {
    back () {
      wx.switchTab({ url: '/pages/index/main' });
    },
    // 跳转邀请有礼活动主页
    to_main () {
      let s_data = wx.getStorageSync('s_data');
      wx.reLaunch({ url: '/pages/package_main/invitation_main/main?act_id=' + (s_data.tg || 0) });
    }

  },
  onLoad () {
    wx.setNavigationBarTitle({
      title: "美亿齿邀请有礼"
    });
    wx.setNavigationBarColor({
      frontColor: '#000000', //前景颜色值，包括按钮、标题、状态栏的颜色，仅支持 #ffffff 和 #000000,
      backgroundColor: '#ffffff', //背景颜色值，有效值为十六进制颜色,
      success: res => { }
    });
  },
  onShow () {
  }
};
</script>

<style lang="less" scoped>
.container {
  width: 100%;
  height: 100%;
  .content {
    width: 100%;
    min-height: 100%;
    background: rgba(249, 217, 191, 1);
    border-radius: 28px 28px 0px 0px;
    .top {
      width: 339px;
      margin: 94px auto 0;
      .img {
        width: 100%;
        display: block;
      }
    }
    .model {
      width: 100%;
      margin: 115px auto 0;
      &.login {
        .login-btn {
          width: 260px;
          height: 36px;
          background: linear-gradient(
            226deg,
            rgba(254, 120, 161, 1) 0%,
            rgba(254, 123, 136, 1) 100%
          );
          border-radius: 8px;
          font-size: 14px;
          font-family: "PingFangSC-Medium", "PingFang SC";
          font-weight: 500;
          color: rgba(255, 255, 255, 1);
          line-height: 36px;
          text-align: center;
          margin: 0 auto 24px;
        }
        .back-btn {
          width: 260px;
          height: 36px;
          background: rgba(255, 255, 255, 1);
          border-radius: 8px;
          font-size: 14px;
          font-family: "PingFangSC-Medium", "PingFang SC";
          font-weight: 500;
          color: rgba(170, 170, 170, 1);
          line-height: 36px;
          text-align: center;
          margin: 0 auto 10px;
        }
      }
    }
  }
}
</style>
